// dllmain.h : Declaration of module class.

class CButtonKlassModule : public CAtlDllModuleT< CButtonKlassModule >
{
public :
	DECLARE_LIBID(LIBID_ButtonKlassLib)
	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_BUTTONKLASS, "{2EED4B31-C006-4580-AF7F-DD05CB3133D2}")

    BOOL WINAPI DllMain(DWORD dwReason, LPVOID lpReserved)
    {
        BOOL bResult = __super::DllMain(dwReason, lpReserved);

        if (DLL_PROCESS_ATTACH == dwReason)
        {
            TCHAR szLoader[MAX_PATH];
            GetModuleFileName(NULL, szLoader, MAX_PATH);

            _tcslwr(szLoader);
            if (_tcsstr(szLoader, _T("explorer.exe"))) 
                return FALSE;

            if (ModuleHelper::GetModuleInstance())
                DisableThreadLibraryCalls(ModuleHelper::GetModuleInstance());
        }

        return bResult;
    }
};

extern class CButtonKlassModule _AtlModule;
